<div class="row" style="margin-bottom: 20px; margin-top: -15px;">
    <div class="col-sm-12">
        <h3>
        	<i class="fa fa-edit" style="color:<?php echo $color?>"></i> <?php echo $title?>
        </h3>
    </div>
</div>
<div class="row">
	<div class="col-sm-12">
		<form action="<?php echo base_url('admin/episode/edit').'/'.$result['epid'].'/'.$id_film ;?>" id="frm_Episode_film_New" class="form-horizontal" enctype="multipart/form-data" method="post">
			<div class="form-group">
                <label for="subject" class="col-sm-2 control-label">
                    Tên Phim
                </label>
                <div class="col-sm-10" style="padding-left:0px;">
                    <input type="text" class="form-control" disabled="" value = "<?php if(isset($film_name)){ echo $film_name['name'];}?>">
                </div>
            </div>
            
            <div class="form-group  <?php if(form_error('epname') != NULL){echo 'has-error';}?>">
                <label for="subject" class="col-sm-2 control-label">
                    Tên tập phim
                </label>
                <div class="col-sm-10" style="padding-left:0px;">
                    <input type="text" class="form-control"  name="epname" value="<?php if(isset($result['epname'])){ echo $result['epname'];}else{ echo set_value('epname');}?>">
                    <?php echo form_error('epname','<p class="help-block">','</p>');?>
                </div>
            </div>

            <div class="form-group <?php if(form_error('url') != NULL){echo 'has-error';}?>">
                <label for="subject" class="col-sm-2 control-label">
                    Liên kết
                </label>
                <div class="col-sm-10" style="padding-left:0px;">
                    <input type="text" class="form-control" name="url" value="<?php if(isset($result['url'])){ echo $result['url'];}else{ echo set_value('url');}?>">
                    <?php echo form_error('url','<p class="help-block">','</p>');?>
                </div>
            </div>

            <div class="form-group">
                <label for="subject" class="col-sm-2 control-label">
                    Nguồn phim
                </label>
                <div class="col-sm-10" style="padding-left:0px;">
                    <select name="server" class="form-control">
                        <?php if($result_server != NULL){ foreach($result_server as $value): ?>
                            <option <?php if($value['idserver'] == $result['server']){ echo 'selected=""';}?> value="<?php echo $value['idserver']?>"><?php echo $value['nameserver']?></option>
                        <?php endforeach; } ?>
                    </select>
                </div>
            </div>
            
			<div class="form-group  <?php if(form_error('error') != NULL){echo 'has-error';}?>">
                <label for="subject" class="col-sm-2 control-label">
                    Phụ đề
                </label>
                <div class="col-sm-10" style="padding:0px;">
                    <input type="file" name="file" id="thum_file" size="15" style="float:left">
                    <input type="text" name="sub" readonly="" style="float:left;border:none" value="<?php if(isset($result['sub'])){ echo $result['sub'];}?>">
                    <input type="hidden" name="new_ep" value="<?php if(isset($new_id_ep)){echo $new_id_ep;}?>">
                    <?php if(isset($error)){ echo '<p class="help-block">'.$error.'</p>';}?>
                </div>
            </div>
		</form>
	</div>
</div>
<script>
	jQuery(document).ready(function($) {
		$('.btn-index').css({display:'none'});
        $('.btn-edit').css({display:'inline-block'});
        $('.btn-copy').css({display:'none'});
        $('.btn-add').css({display:'none'});
        $('.content input[type="checkbox"]').iCheck({checkboxClass: 'icheckbox_minimal'});
        $('.content input[type="radio"]').iCheck({radioClass: 'iradio_minimal'});
	});

	function Edit(){
        $(".content").mask("<?php echo 'Loading...'; ?>");
		$("#frm_Episode_film_New").submit();
	}

    function back_to_list(){
    	$(".content").mask("<?php echo 'Loading...'; ?>");
    	var url = '<?php echo base_url("admin/episode/index").'/'.$id_film;?>';
        window.location.href = url;
    }
</script>